package com.smart.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class LogoutController {

	@RequestMapping(value="/pc/logout", method = RequestMethod.POST)
    public void loginCheck(HttpServletRequest req,HttpServletResponse resp)
    {
		boolean success=true;
		HttpSession session=req.getSession();
		session.invalidate();
		PrintWriter out=null;
		try {
			out=resp.getWriter();
			out.print(success);
			out.flush();
		} catch (IOException e)
		{
			e.printStackTrace();
		}
		finally
		{
			if(out!=null)   out.close();
		}
    }
}
